<?php
namespace app\home\controller;

use app\home\model\TakeoutModel;
use think\Controller;
use think\Request;

class Takeout extends Controller
{
    public function __construct(Request $request = null)
    {
        $result = $this->_getBid();
        if(!$result){
            $this->success('未登录', 'index/login');
        }
    }
    /**
     * 提现审核
     */
    public function index(){
        $bid = $this->_getBid();
        $list = TakeoutModel::instance()->recordposit($bid);
        
        return view('takeout/index',['data'=>$list]);
    }
    /**
     * 提现记录
     */
    public function record()
    {
        $bid = $this->_getBid();
        $list = TakeoutModel::instance()->deposit($bid);
        return view('takeout/record',['data'=>$list]);
    }
    /**
     * 提现审核操作  同意
     *
     */
    public function consent(Request $request){
        $id = $request->get('id');
        $result = TakeoutModel::instance()->taconsent($id);
        return $result;
    }
    /**
     * 拒绝
     * 拒绝提现之后返还提现金额
     */
    public function refuse(Request $request){
        $id = $request->get('id');
        $result = TakeoutModel::instance()->tarefuse($id);
        return $result;
    }

}
